<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Cates extends Model{
    const STATUS_1 = 1;//正常
    const STATUS_2 = 2;//锁定
    const OPTION_0 = 0;//未推荐
    const OPTION_1 = 1;//推荐
    const STATUS_TEXT = [
        self::STATUS_1 => '<span class="el-tag">正常</span>',
        self::STATUS_2 => '<span class="el-tag el-tag--danger">锁定</span>',
    ];
    const OPTION_TEXT = [
        self::OPTION_0 => '<span class="el-tag">否</span>',
        self::OPTION_1 => '<span class="el-tag">是</span>',
    ];
    protected $table = 'cates';
    protected $fillable = [
        'name','status','option', 'avatar',
    ];
    public $timestamps = false;

    public function videos(){
        return $this->hasMany('App\Models\Videos','id', 'cate_id');
    }

}
